
import http from "./http"


const getAbsentTypes = () =>{
    const path = "/absent/type"
    return http.get(path)
}

const getResponder =() =>{
    const path = '/absent/responder'
    return http.get(path)
}

const applyAbsent = (data) =>{
    const path = "/absent"
    return http.post(path,data)
}

const getMyAbsents = (page=1)=>{
    const path = "/absent?who=my&page="+page
    return http.get(path)
}

// 下属考勤
const getSubAbsent = (page=1) =>{
    const path = "/absent?who=sub&page=" + page
    return http.get(path)
}

const handleSubAbsent = (absent_id,status,response_content) =>{
    const path = "/absent/"+absent_id
    return http.put(path,{status,response_content})
}

export default {
    getAbsentTypes,
    getResponder,
    applyAbsent,
    getMyAbsents,
    getSubAbsent,
    handleSubAbsent
}